const Router = require('koa-router'),
      router = new Router,
      fs = require('fs'),
      {Test} = require('./test.js');


let html = fs.readFileSync('./index.html').toString('utf8');


router.get('/',async(ctx,next)=>{
  ctx.body = html;
})
router.post('/',async(ctx,next)=>{
  let {input} = ctx.request.body;
  let res = await Test(input);
  ctx.body = res;
})

module.exports = router

